package com.shardingjdbcdemo.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.shardingjdbcdemo.domain.Course;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * @author ：问北
 * @date ：2022年4月12日16:01:10
 * @description:
 **/
public interface CourseMapper extends BaseMapper<Course> {

    @Select("select * from course")
    List<Course> queryAllCourse();

    @Select("<script>" +
            " select t.* from course t " +
            " where t.cid in" +
            " <foreach collection='cids' item='id' open='(' separator=',' close=')'>" +
            " #{id}" +
            " </foreach>" +
            " </script>")
    List<Course> queryByCids(@Param("cids") List<Long> cids);
}
